package com.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.entity.User;
import com.mapper.UserMapper;


@RestController
public class IndexController {
	@Autowired
	private UserMapper userMapper;

	@RequestMapping("/mybatisSelect")
	public String mybatisSelect() {
		User user = userMapper.findByName("zhangsan");
		System.out.println(user.getName());
		return "suceess";
	}
	
	@RequestMapping("/mybatisInsert")
	public String mybatisInsert() {
		int  i = userMapper.insert("zhangsan", 11);
		return "suceess";
	}

}
